 function update(id){
    $("#update_catnews"+id).colorbox({
        width:"600", height:"350", iframe:true,
        onClosed:function(){ location.reload(); }
    });                               
 }

 function printer(){
    $("#printer").colorbox({
        width:"1000", height:"600", iframe:true
    });                               
 } 
 
 function updatequantri(id){
    $("#updatequantri"+id).colorbox({
        width:"400", height:"450", iframe:true,
        onClosed:function(){ location.reload(); }
    });                               
 }
 function view(id){
    $("#view"+id).colorbox({
        width:"800", height:"500", iframe:true
    });                               
 }
 
function change_price(id){
	 $('#'+id).blur(function() {
		$(this).formatCurrency({ colorize: true, roundToDecimalPlace: 0 });
	})
	.keyup(function(e) {
		var e = window.event || e;
		var keyUnicode = e.charCode || e.keyCode;
		if (e !== undefined) {
			switch (keyUnicode) {
				case 16: break; // Shift
				case 17: break; // Ctrl
				case 18: break; // Alt
				case 27: this.value = ''; break; // Esc: clear entry
				case 35: break; // End
				case 36: break; // Home
				case 37: break; // cursor left
				case 38: break; // cursor up
				case 39: break; // cursor right
				case 40: break; // cursor down
				case 78: break; // N (Opera 9.63+ maps the "." from the number key section to the "N" key too!) (See: http://unixpapa.com/js/key.html search for ". Del")
				case 110: break; // . number block (Opera 9.63+ maps the "." from the number block to the "N" key (78) !!!)
				case 190: break; // .
				default: $(this).formatCurrency({ colorize: true, negativeFormat: '%%n', roundToDecimalPlace: -1, eventOnDecimalsEntered: true });
			}
		}
	})
}
function get_district(value,elm){    
        if(value!=0)
        {
            $.post(url+"order/get_district",{cityid  : value},function (data) {
                    if(data!=''){
                        $("#"+elm).html(data.listcity);
                    }else{
                        $("#"+elm).html("<option value=\"0\">Chọn Quận/ Huyện</option>");   
                    }
                },'json'
            );                       
        }else{
            $("#"+elm).html("<option value=\"0\">Chọn Quận/ Huyện</option>");
        }   
}

function get_district_gb(value,elm){    
	if(value!=0)
	{
		$.post(url+"donhang/get_district",{cityid  : value},function (data) {
				if(data!=''){
					$("#"+elm).html(data.listcity);
				}else{
					$("#"+elm).html("<option value=\"0\">Chọn Quận/ Huyện</option>");   
				}
			},'json'
		);                       
	}else{
		$("#"+elm).html("<option value=\"0\">Chọn Quận/ Huyện</option>");
	}   
}
jQuery(function($) {
    $("#addimages").colorbox({
        width:"730", height:"500", iframe:true     
    });
});